		<?php $routeName = sfContext::getInstance()->getRouting()->getCurrentRouteName() ?>
		<div id="sidebar" >
			<?php include_component('searcher', 'sideboxRechercheDirecte') ?>
			<?php include_partial('global/suggestionsSidebar') ?>
			<?php if ($routeName!='list_favorites'): ?>
				<?php include_component('searcher', 'sideboxFavorites') ?>
			<?php endif; ?>
			<!-- <?php include_component('searcher', 'sideboxVisited') ?> -->
		</div>	
	
		<div id="main">		
<div id="breadcrumbs"><?php echo link_to(__("Home"), '@homepage') ?> > <?php echo link_to(__("Location"), '@searcher_'.$sf_user->getLangCulture()) ?> > <?php echo __("FindYourHome") ?></div>
	<div id="searcher"> 
		<h1><?php echo __("FindYourHome") ?></h1>
		<form class="searcherForm" action="<?php echo url_for('searcher/activeLocations') ?>" method="GET">
			<div class="formComponent"><?php echo $form['from_date']->renderRow(array('id'=>'datepicker')) ?></div>
			<div class="formComponent"><?php echo $form['semaines']->renderRow() ?></div>
			<div class="formComponent"><?php echo $form['personnes']->renderRow() ?></div>
			<div class="formComponent"><?php echo $form['appt_villa']->renderRow() ?></div>
			<div class="formComponent"><?php echo $form['piscine']->renderRow() ?></div>
			<input type="hidden" name="crit" value="<?php echo $sf_params->get('crit') ?>" />
			<input type="hidden" name="order" value="<?php echo $sf_params->get('order') ?>" />
			<label for="prix">&nbsp;</label>
			<div class="formSubmit"><input type="submit" value="<?php echo __("Search") ?>"/></div>
			
		<!--  
		 <?php echo $sf_params->get('personnes') ?> - <? echo $nbViviendas ?>
		 -->
		
	<script type="text/javascript">
			$(function() {
				jQuery("#datepicker").datepicker({ minDate: new Date(<?php echo $startDateSearcher[2] ?>, <?php echo $startDateSearcher[1]-1 ?>, <?php echo $startDateSearcher[0] ?>), beforeShowDay: jQuery.datepicker.onlyWeekends, showOn: "button", buttonImage: "/images/calendar.png", buttonImageOnly: true, dateFormat: "dd-mm-yy", numberOfMonths: 3,
			stepMonths: 3, showButtonPanel: true, firstDay: 1, buttonText: '<?php echo __("Calendar") ?>'
			});
			jQuery.datepicker.setDefaults(jQuery.datepicker.regional['<?php echo $sf_user->getLangCulture() ?>']);
			<?php $arrDay = ViviendaAlquiler::checkMinDate();$from = strtotime($arrDay[0]."-".($arrDay[1])."-".$arrDay[2]); if(date("D",$from)!='Fri'){$from = strtotime('next Friday', $from);}?>
			if(jQuery("#datepicker").attr('value')==''){
			 jQuery("#datepicker").val('<?php echo date("d-m-Y",$from) ?>');
			}
			});
		</script>
 </form>
		</div> 
		<div id="nbResults"><?php echo $pager->getNbResults() ?> <?php echo __("residences")?>. <?php echo $pager->getFirstIndice() ?> - <?php echo $pager->getLastIndice() ?></div>
		<?php if ($pager->haveToPaginate()): ?>
		<div class="pagination-searcher-top-home">
<ul class="pagination-flickr">
  
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <li>
	<a 
	<?php if ($sf_params->get('page')==$page): ?>
		class='active'
	<?php endif ?>	
		href="<?php echo url_for('searcher_'.$sf_user->getLangCulture()) ?>/<?php echo $page ?>/<?php echo $sf_params->get('personnes')?>/<?php echo $sf_params->get('semaines') ?>/<?php if($sf_params->get('appt_villa')!=''){echo $sf_params->get('appt_villa');}else{echo '3';} ?>/<?php if($sf_params->get('piscine')!=''){echo $sf_params->get('piscine');}else{echo '4';} ?>/<?php echo str_replace("-", "_", $sf_params->get('from_date')) ?>/<?php if($sf_params->get('crit')!=''){echo $sf_params->get('crit');}else{echo 'piscine';} ?>/<?php if($sf_params->get('order')!=''){echo $sf_params->get('order');}else{echo 'asc';} ?>">
    <?php echo $page ?></a>
	</li>
  <?php endforeach ?>
 </ul>
</div>
	<?php endif ?>	
	
	<div id="ordonner">
	<?php if ($sf_params->get('from_date')!=0):?>
		<?php echo __("orderBy") ?>: 
		<?php if($sf_params->get('piscine') == '4'): ?>
		<a class="crit<?php if($sf_params->get('crit')=='piscine')echo ViviendaAlquiler::getOppositeOrder($sf_params->get('order')) ?>" <?php if($sf_params->get('crit')=='piscine')echo 'style="background-color:#F5F5F5;font-weight:bold;"' ?> href="<?php echo url_for('searcher_'.$sf_user->getLangCulture()) ?>/<?php echo $pager->getPage() ?>/<?php echo $sf_params->get('personnes')?>/<?php echo $sf_params->get('semaines') ?>/<?php echo $sf_params->get('appt_villa') ?>/<?php echo $sf_params->get('piscine') ?>/<?php echo str_replace("-", "_", $sf_params->get('from_date')) ?>/piscine/<?php echo ViviendaAlquiler::getOppositeOrder($sf_params->get('order')) ?>"><?php echo __("swimmingpool") ?></a>
		- 
		<?php endif; ?>
		<a class="crit<?php if($sf_params->get('crit')=='capacite')echo ViviendaAlquiler::getOppositeOrder($sf_params->get('order')) ?>" title="<?php echo ViviendaAlquiler::getTitleOrder($sf_params->get('order'), $sf_params->get('crit')) ?>" <?php if($sf_params->get('crit')=='capacite')echo 'style="background-color:#F5F5F5;font-weight:bold;"' ?> href="<?php echo url_for('searcher_'.$sf_user->getLangCulture()) ?>/<?php echo $pager->getPage() ?>/<?php echo $sf_params->get('personnes')?>/<?php echo $sf_params->get('semaines') ?>/<?php echo $sf_params->get('appt_villa') ?>/<?php echo $sf_params->get('piscine') ?>/<?php echo str_replace("-", "_", $sf_params->get('from_date')) ?>/capacite/<?php echo ViviendaAlquiler::getOppositeOrder($sf_params->get('order')) ?>"><?php echo __("people") ?></a>
		<?php endif; ?>
	</div>
	<div id="postResults">
	<?php foreach($pager->getResults() as $vivienda): ?>
		<div class="post">
				<div id="minimumPrice"></div>	
				<h1><a style="text-decoration: underline;" href="<?php echo url_for('location_show', ViviendaAlquiler::getSlugVivienda($vivienda->getId())) ?><?php echo $vivienda->getViviendaSluggie($vivienda->getId()) ?>"><?php echo ucwords(__(ViviendaAlquiler::getSlugVivienda($vivienda->getApartCasa())))." ".ucwords($vivienda->getNombre()) ?></a><span class="village"><span class="zone"><?php echo $vivienda->getZonas()->getZona().",</span> ".$vivienda->getZonas()->getLocalidades()->getLocalidad() ?></span></h1>
				<?php if (count($vivienda->getFoto()) > 0 && $vivienda->getGaleria()): ?>
				<p>
				<a href="<?php echo url_for('location_show', ViviendaAlquiler::getSlugVivienda($vivienda->getId())) ?><?php echo $vivienda->getViviendaSluggie($vivienda->getId()) ?>"><?php echo image_tag(sfConfig::get('app_static_domain_fotos').$vivienda->getUsuarioId().'/'.$vivienda->getId().'/thumbs/'.$vivienda->getFoto()->getFirst()->getNombrefoto(), 'class=float-left width=100 height=75 alt='.ucwords($vivienda->getSlug()).' '.$vivienda->getNombre()) ?></a>
				</p>
				<?php else: ?>
				<p><a href="<?php echo url_for('location_show', ViviendaAlquiler::getSlugVivienda($vivienda->getId())) ?><?php echo $vivienda->getViviendaSluggie($vivienda->getId()) ?>"><?php echo image_tag('/fotos/oficina1.jpg', 'class=float-left width=100 height=75 alt='.ucwords($vivienda->getSlug()).' '.$vivienda->getSlug()) ?></a></p>
				<?php endif; ?>
				<p><?php if(isset($arrViviendasPrecios[$vivienda->getNombre()]))echo $arrViviendasPrecios[$vivienda->getNombre()];?></p>
				<p style="font-size: 14px;"><?php echo $vivienda->getDescRed($sf_user->getLangCulture()) ?></p>
				<?php if($vivienda->hasOfertaVivienda($vivienda)==1): ?>
					<p class="enOferta"><a href="<?php echo url_for('location_show', ViviendaAlquiler::getSlugVivienda($vivienda->getId())) ?><?php echo $vivienda->getViviendaSluggie($vivienda->getId()) ?>"><?php echo __('enOferta') ?></a></p>
				<?php endif ?>
				<p class="post-footer"><?php include_component('location', 'viviendaFeatures', array('vivienda'=>$vivienda)) ?></p>
		</div>
			<?php endforeach ?>		
	</div>					
		
	<?php if ($pager->haveToPaginate()): ?>
		<div class="pagination-searcher-bottom">
	<ul class="pagination-flickr">
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <li>
	<a 
	<?php if ($sf_params->get('page')==$page): ?>
		class='active'
	<?php endif ?>	
		href="<?php echo url_for('searcher_'.$sf_user->getLangCulture()) ?>/<?php echo $page ?>/<?php echo $sf_params->get('personnes')?>/<?php echo $sf_params->get('semaines') ?>/<?php if($sf_params->get('appt_villa')!=''){echo $sf_params->get('appt_villa');}else{echo '3';} ?>/<?php if($sf_params->get('piscine')!=''){echo $sf_params->get('piscine');}else{echo '4';} ?>/<?php echo str_replace("-", "_", $sf_params->get('from_date')) ?>/<?php if($sf_params->get('crit')!=''){echo $sf_params->get('crit');}else{echo 'piscine';} ?>/<?php if($sf_params->get('order')!=''){echo $sf_params->get('order');}else{echo 'asc';} ?>">
    <?php echo $page ?></a>
	</li>
  <?php endforeach ?>
	</ul>
	<?php endif ?>	

</div>
</div>